package com.tanhua.manager.job;

import com.tanhua.manager.service.AnalysisByDayService;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class AnalysisJob {

    @Autowired
    private AnalysisByDayService analysisByDayService;

//    @Scheduled(cron = "0 0/30 * * * ?") //每隔30分钟
    @Scheduled(cron = "0/10 * * * * ?") //每隔30分钟
    public void analysis(){

        String todayStr = DateTime.now().toString("yyyy-MM-dd");
        analysisByDayService.analysis(todayStr);
        System.out.println("30分钟统计一次...............");

    }


}
